﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Library.Navigation;
using LibraryTest.Models.Navigation;

namespace LibraryTest.Views.NavigationProviderTest
{
    public partial class Page1 : PhoneApplicationPage
    {
        public Page1()
        {
            InitializeComponent();
            NavigationProvider.Instance.Navigated += new NavigationProviderEventHandler(OnNavigated);
            NavigationProvider.Instance.Navigating += new NavigationProviderCancellableEventHandler(OnNavigating);


        }

        private void OnNavigating(object sender, NavigationProviderCancellableEventArgs e)
        {
            
        }

        private void OnNavigated(object sender, NavigationProviderEventArgs e)
        {
            
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var page2Parameters = new Page2Parameter
            {
                Id = 100,
                Title = "From code"
            };

            NavigationProvider.Instance.Navigate(NavigationSource.NavigationSamplePage2, page2Parameters);
        }
    }
}